/************************************
 * Package: RGcpp					*
 * Authors: Rui Eduardo Gouveia Gil	*
 * Date: 2010						*
 ************************************/
#include "rgcpp/sys/SysLogger.h"
#ifndef _WIN32
namespace rgcpp
{

void SysLogger::logEmergency(const std::string& message, int facility)
{
	SysLogger::log(LOG_EMERG,facility,message);
}

void SysLogger::logAlert(const std::string& message, int facility)
{
	SysLogger::log(LOG_ALERT,facility,message);
}

void SysLogger::logCritical(const std::string& message, int facility)
{
	SysLogger::log(LOG_CRIT,facility,message);
}

void SysLogger::logError(const std::string& message, int facility)
{
	SysLogger::log(LOG_ERR,facility,message);
}

void SysLogger::logWarning(const std::string& message, int facility)
{
	SysLogger::log(LOG_WARNING,facility,message);
}

void SysLogger::logNotice(const std::string& message, int facility)
{
	SysLogger::log(LOG_NOTICE,facility,message);
}

void SysLogger::logInfo(const std::string& message, int facility)
{
	SysLogger::log(LOG_INFO,facility,message);
}

void SysLogger::logDebug(const std::string& message, int facility)
{
	SysLogger::log(LOG_DEBUG,facility,message);
}

void SysLogger::log(int logLevel, int facility, const std::string& message)
{
	 openlog("slog", LOG_PID|LOG_CONS, facility);
	 syslog(logLevel,message.c_str(),message.size());
	 closelog();
}

}
#endif